﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Zwms.Client.CommonUI;
using Zwms.Data.BusinessObjects;

namespace Zwms.Client.OutWms
{
    public partial class OPBillDetailInputForm : BaseForm
    {
        private BilOutPlanBill _opBill = null;
         private List<BilOutPlanBillDetail> _oPBillDetailList = null;
         public OPBillDetailInputForm(BilOutPlanBill opBill,List<BilOutPlanBillDetail> oPBillDetailList)
        {
            InitializeComponent();
            _opBill = opBill;
            _oPBillDetailList = oPBillDetailList;
            InitBtnImage();
            InitControl();
        }

        #region 私有函数
         private void InitBtnImage()
         {
             this.btnConfirm.Image = global::Zwms.Client.Properties.Resources.ok;
             this.btnCancel.Image = global::Zwms.Client.Properties.Resources.cancel;
         }

         private void InitControl()
         {
             tbOpBillCode.Text = _opBill.Id;
             tbWarehouseName.Text = _opBill.WarehouseName;
             this .bilOutPlanBillDetailBindingSource.DataSource = null;
             if (_oPBillDetailList.Count > 0)
             {
                 this.bilOutPlanBillDetailBindingSource.DataSource = _oPBillDetailList;
             }
         }
        #endregion

         private void btnConfirm_Click(object sender, EventArgs e)
         {
             this.DialogResult = System.Windows.Forms.DialogResult.OK;
             this.Close();
         }

         private void btnCancel_Click(object sender, EventArgs e)
         {
             this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
             this.Close();
         }
    }
}
